flowchart TD
    classDef ltrGraph fill:#797;
    classDef rtlGraph fill:#779,stroke-width:4px;
    classDef noneGraph fill:#977,stroke-width:4px,stroke-dasharray: 5 5;
    subgraph legend["Legend"]
    subgraph legend0[" "]
    legend00["Left-to-right"]
    end
    subgraph legend1[" "]
    legend10("Right-to-left")
    end
    subgraph legend2[" "]
    legend20["Requires parentheses"]
    end
    class legend0 ltrGraph;
    class legend1 rtlGraph;
    class legend2 noneGraph;
    end
    A["(...)"]
    subgraph primary["Primary"]
    primary0["a()"]
    primary1["a[]"]
    primary2["a.b"]
    end
    subgraph unary["Unary"]
    unary0("-a")
    unary1("!a")
    unary2("~a")
    unary3("*a")
    unary4("&a")
    end
    subgraph multiplicative["Multiplicative"]
    multiplicative0["a*b"]
    multiplicative1["a/b"]
    multiplicative2["a%b"]
    end
    subgraph additive["Additive"]
    additive0["a+b"]
    additive1["a-b"]
    end
    subgraph shift["Shift"]
    shift0["a&lt;&lt;b"]
    shift1["a>>b"]
    end
    subgraph relational["Relational"]
    relational0["a&lt;b"]
    relational1["a>b"]
    relational2["a&lt;=b"]
    relational3["a>=b"]
    relational4["a==b"]
    relational5["a!=b"]
    end
    subgraph binary0["Binary AND"]
    binary00["a&b"]
    end
    subgraph binary1["Binary OR"]
    binary10["a|b"]
    end
    subgraph binary2["Binary XOR"]
    binary20["a^b"]
    end
    subgraph shortcircuit0["Short-circuit AND"]
    shortcircuit00["a&&b"]
    end
    subgraph shortcircuit1["Short-circuit OR"]
    shortcircuit10["a||b"]
    end
    class primary ltrGraph;
    class unary rtlGraph;
    class multiplicative ltrGraph;
    class additive ltrGraph;
    class shift noneGraph;
    class relational noneGraph;
    class binary0 ltrGraph;
    class binary1 ltrGraph;
    class binary2 ltrGraph;
    class shortcircuit0 ltrGraph;
    class shortcircuit1 ltrGraph;
    A-->primary;
    primary-->unary;
    unary-->multiplicative;
    unary-->shift;
    unary-->binary0;
    unary-->binary1;
    unary-->binary2;
    multiplicative-->additive
    additive-->relational;
    shift-->relational;
    relational-->shortcircuit0;
    relational-->shortcircuit1;
